import request from '@/plugin/axios'
import util from '@/libs/util.js'
export function getProject (city,zone,pageno,pagesize,parentName,isall) {
    let data = {};
    if(!isall){
        data.city = city
        data.zone = zone
        data.pageno = pageno
        data.pagesize = pagesize

        data.UserId = util.cookies.get('uuid')

    }else{
        data.pageno = pageno
        data.pagesize = pagesize
        data.parentName = parentName
    }

    return request({
        url: '/Project/List',
        method: 'post',
        data
    })
}
export function getUserProject (pageno,pagesize,userId,forminline) {
    let data = {};
    if(pageno !==null){

        data.pageno = pageno
        data.pagesize = pagesize
        if(userId == null){
            data.UserId = util.cookies.get('uuid')
        }else{
            data.UserId = userId
        }

    }
    if(forminline){
        data = Object.assign(data,forminline)

    }
    return request({
        url: '/Project/List',
        method: 'post',
        data
    })
}

export function getProjectDevice (pageno,pagesize,ID,ProjectNo,devType,formInline) {
    let data = {};
    if(pageno !==null){
        data.pageno = pageno
        data.pagesize = pagesize
        data.ProjectNo = ProjectNo
        data.ID = ID
        data.devType = devType
        data.UserId = util.cookies.get('uuid')
    }

    if(formInline){
        data = Object.assign(data,formInline)

    }
    return request({
        url: '/Collector/List',
        method: 'post',
        data
    })
}
